package org.amphiprion.descentv2assistant.filter;

import java.util.ArrayList;
import java.util.List;

public class ExcludeFilter implements IdFilter {
	private String filterType;
	private final List<String> excluded = new ArrayList<String>();

	@Override
	public boolean contains(String id) {
		return !excluded.contains(id);
	}

	public void checkTrait(String id) {
		if (excluded.contains(id)) {
			excluded.remove(id);
		} else {
			excluded.add(id);
		}
	}

	@Override
	public void clear() {
		excluded.clear();
	}

	@Override
	public String getFilterType() {
		return filterType;
	}

	public void setFilterType(String filterType) {
		this.filterType = filterType;
	}

}
